package com.hr.牛客网剑指offer;

/**
 * @author zhz
 * @date 2020/08/23
 **/
public class JZ9_变态跳台阶 {
    public int JumpFloorII(int target) {
        if (target==0 || target==1 || target==2){
            return target;
        }
        int[] dp=new int[target+1];
        dp[0]=0;
        dp[1]=1;
        dp[2]=2;
        for (int i = 3; i < target+1; i++) {
            dp[i]=2*dp[i-1];
        }
        return dp[target];
    }
}
